package com.example.medicalretrieval;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.medicalretrieval.adapter.BrowsingHistoryAdapter;
import com.example.medicalretrieval.adapter.PDFItemAdapter;
import com.example.medicalretrieval.dao.BrowsingHistoryDao;
import com.example.medicalretrieval.pojo.BrowsingHistory;

import java.util.List;

public class BrowsingHistoryActivity extends AppCompatActivity {

    private BrowsingHistoryDao browsingHistoryDao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_browsing_history);
        ListView browsingList = findViewById(R.id.browsingList);
        browsingHistoryDao = MyApplication.getInstance().getBrowsingHistoryDataBase().browsingHistoryDao();

        List<BrowsingHistory> browsingHistoryList = browsingHistoryDao.queryByTimeOfDESC();
        BrowsingHistoryAdapter adapter = new BrowsingHistoryAdapter(this,browsingHistoryList);
        browsingList.setAdapter(adapter);
    }
}